const home = {
  namespaced: true, // 开启module的命名空间
  state() {
    return {
      count: 1
    }
  },
  mutations: {
    add(state) {
      state.count++
    },
    jianshao(state) {
      state.count--
    }
  },
  actions: {
    actionAdd({state}) {
      setTimeout(() => {
        state.count++
      }, 2000)
    }
  },
  getters: {
    getMaxCount(state) {
      return state.count > 10 ? 10 : state.count
    },
    getMinCount(state) {
      return state.count < -10 ? -10 : state.count
    }
  }
}
export default home